<?php
/*
 * Form - Quá trình học vấn
 */
?>
<style>
    .modal {
    margin: -287px 0 0 -277px;
    width: 569px;
}
    .modal-body {
        max-height: 482px;
        overflow-y: auto;
        padding: 15px;
    }
</style>
<?php
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
    'id' => 'nguoithamkhao-form',
    'type' => 'horizontal',
    'action' => Yii::app()->createUrl('ungvien/tintimviec/') . ($hid != '' && $tid != '') ? '?id=' . $hid . '&tid=' . $tid . '#step6' : '',
    'enableClientValidation' => true,
    //'enableAjaxValidation' => true,
    'clientOptions' => array(
        'validateOnSubmit' => true,
    ),
        ));
?>
<legend class='title-field title-jobs mt_20'><i class='icon icon-plus-sign mt_5 icon-white'></i> Người tham khảo</legend>
<div class='info-job'>
    <?php echo $form->textFieldRow($model, 'hoten', array('class' => 'span4')); ?>
    <?php echo $form->textFieldRow($model, 'congty', array('class' => 'span4')); ?>
    <?php echo $form->textFieldRow($model, 'chucvu', array('class' => 'span4')); ?>
    <?php echo $form->textFieldRow($model, 'dienthoai', array('class' => 'span4')); ?>
    <?php echo $form->textFieldRow($model, 'email', array('class' => 'span4')); ?>
    <?php echo $form->radioButtonListInlineRow($model, 'moiquanhe', array('1' => 'Công việc', '2' => 'Cá nhân')); ?>
    <div class='div-row'>
        <label class='mt w150'>&nbsp;</label>
        <p class='nn-row'>
            <?php $this->widget('bootstrap.widgets.TbButton', array('buttonType' => 'submit', 'type' => 'primary', 'label' => 'Lưu', 'icon' => 'icon-ok icon-white')); ?>
            <?php $this->widget('bootstrap.widgets.TbButton', array('buttonType' => 'reset', 'type' => 'primary', 'label' => 'Bỏ qua', 'icon' => 'icon-remove-sign icon-white', 'htmlOptions' => array('class' => 'close-form'))); ?>
        </p> 
    </div>
</div>
<?php $this->endWidget(); ?>
<script>
    $(document).ready(function(){
        $('.modal-footer').remove();
        $('#nguoithamkhao-form').yiiactiveform({'validateOnSubmit':true,'attributes':[{'id':'Nguoithamkhao_hoten','inputID':'Nguoithamkhao_hoten','errorID':'Nguoithamkhao_hoten_em_','model':'Nguoithamkhao','name':'Nguoithamkhao[hoten]','enableAjaxValidation':false,'inputContainer':'div.control-group','clientValidation':function(value, messages, attribute) {

if($.trim(value)=='') {
	messages.push("H\u1ecd & t\u00ean kh\u00f4ng \u0111\u01b0\u1ee3c ph\u00e9p r\u1ed7ng.");
}


if($.trim(value)!='') {
	
if(value.length>100) {
	messages.push("H\u1ecd & t\u00ean qu\u00e1 d\u00e0i (t\u1ed1i \u0111a l\u00e0 100 k\u00ed t\u1ef1).");
}

}

}},{'id':'Nguoithamkhao_congty','inputID':'Nguoithamkhao_congty','errorID':'Nguoithamkhao_congty_em_','model':'Nguoithamkhao','name':'Nguoithamkhao[congty]','enableAjaxValidation':false,'inputContainer':'div.control-group','clientValidation':function(value, messages, attribute) {

if($.trim(value)=='') {
	messages.push("C\u00f4ng ty kh\u00f4ng \u0111\u01b0\u1ee3c ph\u00e9p r\u1ed7ng.");
}


if($.trim(value)!='') {
	
if(value.length>200) {
	messages.push("C\u00f4ng ty qu\u00e1 d\u00e0i (t\u1ed1i \u0111a l\u00e0 200 k\u00ed t\u1ef1).");
}

}

}},{'id':'Nguoithamkhao_chucvu','inputID':'Nguoithamkhao_chucvu','errorID':'Nguoithamkhao_chucvu_em_','model':'Nguoithamkhao','name':'Nguoithamkhao[chucvu]','enableAjaxValidation':false,'inputContainer':'div.control-group','clientValidation':function(value, messages, attribute) {

if($.trim(value)=='') {
	messages.push("Ch\u1ee9c v\u1ee5 kh\u00f4ng \u0111\u01b0\u1ee3c ph\u00e9p r\u1ed7ng.");
}


if($.trim(value)!='') {
	
if(value.length>150) {
	messages.push("Ch\u1ee9c v\u1ee5 qu\u00e1 d\u00e0i (t\u1ed1i \u0111a l\u00e0 150 k\u00ed t\u1ef1).");
}

}

}},{'id':'Nguoithamkhao_dienthoai','inputID':'Nguoithamkhao_dienthoai','errorID':'Nguoithamkhao_dienthoai_em_','model':'Nguoithamkhao','name':'Nguoithamkhao[dienthoai]','enableAjaxValidation':false,'inputContainer':'div.control-group','clientValidation':function(value, messages, attribute) {

if($.trim(value)=='') {
	messages.push("\u0110i\u1ec7n tho\u1ea1i kh\u00f4ng \u0111\u01b0\u1ee3c ph\u00e9p r\u1ed7ng.");
}


if($.trim(value)!='') {
	
if(value.length>14) {
	messages.push("\u0110i\u1ec7n tho\u1ea1i qu\u00e1 d\u00e0i (t\u1ed1i \u0111a l\u00e0 14 k\u00ed t\u1ef1).");
}

}

}},{'id':'Nguoithamkhao_email','inputID':'Nguoithamkhao_email','errorID':'Nguoithamkhao_email_em_','model':'Nguoithamkhao','name':'Nguoithamkhao[email]','enableAjaxValidation':false,'inputContainer':'div.control-group','clientValidation':function(value, messages, attribute) {

if($.trim(value)!='') {
	
if(value.length>70) {
	messages.push("Email qu\u00e1 d\u00e0i (t\u1ed1i \u0111a l\u00e0 70 k\u00ed t\u1ef1).");
}

}


if($.trim(value)!='' && !value.match(/^[a-zA-Z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+\/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$/)) {
	messages.push("Email kh\u00f4ng l\u00e0 m\u1ed9t email h\u1ee3p l\u1ec7");
}

}},{'id':'Nguoithamkhao_moiquanhe','inputID':'Nguoithamkhao_moiquanhe','errorID':'Nguoithamkhao_moiquanhe_em_','model':'Nguoithamkhao','name':'Nguoithamkhao[moiquanhe]','enableAjaxValidation':false,'inputContainer':'div.control-group'}]});
    });//end ready
</script>